const longitudeInput = document.querySelector('#longitude');
const latitudeInput = document.querySelector('#latitude');
const convertBtn = document.querySelector('#convert');

const millierConvertionP = document.querySelector('#millier-convertion');

// 处理转换按钮点击事件
const handleConvertClick = () => {
  const millier = millerConvertion(longitudeInput.value, latitudeInput.value);
  console.log(millier);
}

convertBtn.addEventListener('click', handleConvertClick, false);

var options = {
  enableHighAccuracy: false,
  maximumAge: 0
};

function success(pos) {
  var crd = pos.coords;

  console.log('Your current position is:');
  console.log('Latitude : ' + crd.latitude);
  console.log('Longitude: ' + crd.longitude);
  console.log('More or less ' + crd.accuracy + ' meters.');
};

function error(err) {
  console.warn('ERROR(' + err.code + '): ' + err.message);
};

navigator.geolocation.getCurrentPosition(success, error, options);